using SG;
using System;
using UnityEngine;

namespace Game.Gun
{
    public class Gun_Single : GunBase
    {
        public DataSingle m_Data;
        protected override DataGunBase GetGun()
        {
            return m_Data;
        }
        protected override void DoFire()
        {
            var obj = ObjectPoolMgr.Instance().GetFreeObjectFromPool(m_Data.m_BulletProfab , ObjectMgr.Instance().GetTempRoot());
            var com = obj.GetComponent<BulletMove>();
            com.DoInit( GetMuzzle().position, GetTargetPos(), GetDamage());
            com.m_Target.SetTarget( GetTargetOp().Target);
        }

        protected override float GetDamage()
        {
            return m_Data.m_fBaseDamage;
        }
    }
}